<?php
    //require section
    require_once dirname(__FILE__) . '/shared/config/config.php';
    require_once DOCUMENT_ROOT . DIR_INCLUDE . 'check_session.php';
    require_once DOCUMENT_ROOT . DIR_INCLUDE . 'check_outside_booking.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_API . 'api_movies.php';
    $title = 'Movie Detail';

    $m_id = filter_input(INPUT_GET, 'm_id');
    if ($m_id != NULL) {
        $movie = api_movies::get_movie_by_id($m_id);
    }
?>

<!DOCTYPE html>
<html>
<head>
    <?php
        require_once DOCUMENT_ROOT . DIR_INCLUDE . 'head.php';
    ?>
</head>
<body>
<div class="ts-body-container">
    <div class="ts-wrapper">
        <!--<div class="ui grid">-->
        <div class="padding-top-large row">
            <?php
                require_once DOCUMENT_ROOT . DIR_INCLUDE . 'header.php';
            ?>
            <div class="ui segment breadcrumb" style="margin-top: 25px; margin-left: 20px;">
                <a class="section" href="index.php">Home</a>
                <i class="right arrow icon divider"></i>
                <a class="section" href="now_showing.php">Movies</a>
                <i class="right arrow icon divider"></i>
                <div class="active section">Movie Detail</div>
            </div>
        </div>
        <div class="ui grid" id="container">
            <div class="row">
                <div class="column">
                    <h1>Cinema Detail</h1>

                    <div class="ui orange segment">
                        <div class="row">
                            <div class="ts-detail-img-wrapper">
                                <?php if ($movie != NULL) : ?>
                                    <img src="<?php echo LINK_ROOT . DIR_SHARED_UPLOAD_IMAGES_POSTERS . $movie['poster'] ?>">
                                <?php endif; ?>
                            </div>
                            <div class="ts-detail-info">
                                <table>
                                    <tr>
                                        <th>Title</th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <?php
                                                if ($movie != NULL) {
                                                    echo $movie['title'];
                                                }
                                            ?>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Description</th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <?php
                                                if ($movie != NULL) {
                                                    echo $movie['description'];
                                                }
                                            ?>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                        <div class="row">
                            <div class="ts-center">
                                <a href="<?php echo LINK_ROOT ?>" class="ui orange button">Back to Home Page</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <?php
                    require_once DOCUMENT_ROOT . DIR_INCLUDE . 'footer.php';
                ?>
            </div>
            <!--</div>-->
        </div>
    </div>
</body>
</html>